<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>编写一个函数求两个数字之间有多少个质数，返回 质数的个数</title>
</head>

<body>
    <!-- 编写一个函数求两个数字之间有多少个质数，返回 质数的个数 -->
</body>
<script>
    (function () {

        function prime(num1, num2) {
            let minNum = Math.min(num1, num2);
            let maxNum = Math.max(num1, num2);

            let num = 0;
            outer: for (let i = minNum; i <= maxNum; i++) {
                inner: for (let j = i - 1; j < i && j > 1; j--) {
                    if (i % j == 0) {
                        continue outer;
                    }
                }
                num++;
            }
            return num;
        }


        console.log(prime(5, 11));


    })();
</script>

</html>